import React, { ReactElement } from 'react';
import { Button, Modal } from 'choerodon-ui/pro';
import { FuncType, ButtonColor } from 'choerodon-ui/pro/lib/button/enum';
import { TableButtonProps } from 'choerodon-ui/pro/lib/table/Table';
import { clickFunc } from '../../typing.d';


interface CommonAddProps {
  onClick: clickFunc
}

const CommonAdd = ({ onClick }: CommonAddProps): ReactElement<TableButtonProps> => (
  <Button
    funcType={FuncType.flat}
    color={ButtonColor.blue}
    icon="add"
    onClick={onClick}
    key={Modal.key()}
  >
    新增
  </Button>
);

export default CommonAdd;
